1. Field of the Invention
The present invention relates to a data processing system using a computer usable recording medium, and a computer readable recording medium storing a program for accessing the recording medium.
2. Description of the Related Art
A flash memory employing an EEPROM (Electrically Erasable/Programmable Read Only Memory) has been used as a recording medium to be accessed (data write/erase possible) by a computer and the like. In the flash memory, erasure of data is performed in the unit, generally so-called blocks, of the storage capacity.
Defective blocks cause unsuccessful data writing. However, it is difficult to avoid such defective blocks from appearing during manufacturing process for producing a flash memory, especially a NAND type flash memory. A conventional solution for such a problem is an address conversion table. The address conversion table represents a correspondence between at least one physical address and at least one logical address. The address conversion table is prepared by dynamically assigning successive logical addresses to normal blocks, while the physical address has been assigned to each block. Thus prepared address conversion table prevents any procedure for externally-arrived access from being complicated, resulting in addresses being successive.
In a case where the address conversion table represents a correspondence between all logical and physical addresses, size of the address conversion table is proportionate to storage capacity of the flash memory. Therefore, the large flash memory requires a large storage device for storing the enlarged table. As a result, the storage device has the complicated structure.
Zoning is a known solution to avoid the storage device from being complicated. According to this method, the plurality of block are classified into a plurality of zones. The address conversion table is prepared so as to represent the correspondence between logical and physical addresses which belong to one of the zones. If any demand for accessing the blocks in another zone is given, the table is reformed so as to include the logical and physical addresses in the zone concerned.
Since such a table reformation requires an extra process for searching all the blocks in the zone concerned, its processing time is elongated. If the flash memory is under the control of OS (Operating System), the OS usually writes FAT (File Allocation Table) or the like onto the flash memory. The FAT represents a correspondence between data managed by the OS and logical addresses thereof. An access procedure to such an extra table also requires an address conversion table. Therefore, further extra processing for preparing the address conversion table for FAT elongates the processing time further.
The present invention has been made in consideration of the above. It is an object of the present invention to provide a storage device, a storage system and a memory management method that reduce frequency for preparing address conversion tables when accessing data.
In order to achieve the above-described object, according to the first aspect of the present invention, there is provided a storage device, comprising: a memory which includes a plurality of memory blocks, each of which stores data and belongs to one of a plurality of zones and to each of which a physical address is assigned; and a controller which reads data stored in the plurality of memory blocks and externally outputs the read data, wherein the memory block belonging to a predetermined zone includes a data arrangement memory storing a data arrangement table representing a correspondence between data stored in the memory and a logical address of one memory block storing the data, and the controller includes a first table memory, includes a second table memory, creates a first address conversion table storing information representing a correspondence between the logical address and a physical address of the one memory block storing the data arrangement table, and stores the created table in the first table memory, externally acquires a logical address indicating the data arrangement table, specifies the physical address of the one memory block storing the data arrangement table based on the first address conversion table and the acquired logical address, in response to an externally-transmitted instruction, reads out the data arrangement table from the one memory block represented by the specified physical address, and externally sends the read data arrangement table, externally acquires a logical address indicating data to be read, and specifies a zone, to which a memory block represented by the logical address belongs, based on the acquired logical address, determines whether the second table memory stores a second address conversion table, which stores information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, and, when determined that the second table memory does not store the second address conversion table, creates the second address conversion table, and also stores the created table in the second table memory, and specifies, as a physical address indicating target data to be read, the physical address corresponding to the externally-acquired logical address, based on the second address conversion table, and reads out and outputs data stored in the memory block represented by the specified physical address.
According to this storage device, the first address conversion table, which stores the logical address of the memory block storing the data arrangement table, is kept stored in the first table memory regardless of which zone is specified. This eliminates the occurrence of the event where the stored address conversion table is updated every time the data arrangement table is accessed. Thus, lateness in the process of accessing data can be prevented.
The controller may: include an access history memory which stores the physical address, which indicates the target data to be read and which the controller itself has specified, and a logical address representing the physical address, in association with the physical address and the logical address, and specify a physical address indicating target data to be read, based on the physical address and the logical address which the access history memory stores.
According to this structure, even in the case where data including the data arrangement table is accessed, as long as accessing is preformed to the data stored in any block represented by the physical address and the logical address stored in the access history memory, there is no need to create the second address conversion table. Hence, the process of accessing data can be performed with high efficiency.
The controller may: include an empty block table memory which stores an empty block table storing information representing one or more empty blocks each of which comprises one memory block, select, of the one or more empty blocks represented by the information stored in the empty block table, a target empty block to store data, when data which is to be written and a logical address indicating the data are sent to the controller, and write the data to be written in the selected block.
The empty block tables may include: a first empty block table which stores information representing an empty block belonging to a zone including the memory block storing the data arrangement table; and a second empty block table which stores information representing one or more empty blocks belonging to one of the plurality of zones; and the controller may: determine whether the empty block memory stores the second empty block table, which stores information representing the one or more empty blocks belonging to one of the plurality of zones, and, when determined that the empty block memory does not store the second empty block table, creates the second empty block table which stores the information representing the empty blocks belonging to the specified zone, and also stores the created table in the empty block table memory; select, of the empty blocks represented by the information stored in the second empty block table, a target empty block, when data which is to be written and a logical address indicating the data are sent to the controller; write, in the empty block represented by the information stored in the first empty block table, the data arrangement table which has been updated as to represent the correspondence between the data to be written, which the controller itself has written in the empty block, and the logical address indicating the data; and update the first empty block table as not to represent that the memory block storing the updated data arrangement table is an empty block.
According to this structure, when updating the data arrangement table, even in the case where any change occurs in the memory block storing the data arrangement table, another memory block is newly assigned as one for storing the data arrangement table, using the first empty block table which is stored regardless of which zone is specified. When writing data into a memory block, a memory block is newly assigned as one for storing the data, using the second empty block table representing one or more empty blocks included in the specified zone. Thus, even if the empty block table memory has small memory capacity, the process of data writing and the process of updating the data arrangement table can be performed with high efficiency.
The storage device may store origin information in the memory block, for designating an empty block to store data next to a particular block most-recently stores data, and the empty block table may include information representing order numbers which circularly and respectively correspond to the plurality of empty blocks. In this structure, the controller may read the origin information and sequentially select one or more empty blocks including the empty block designated by the read origin information and the empty block following the one represented by the read origin information, when data to be written and a logical address indicating the data are sent to the controller.
By doing this, the process of writing data into empty blocks is cyclically performed one after another. This eliminates the possibility that data is frequently updated only in certain memory blocks. Hence, it is preventable that only some of the memory blocks are deteriorated in its performance, in the case such memory blocks are to be deteriorated upon frequent writing of data thereinto.
The origin information may temporarily be stored in a certain section of an empty block which is to store data next to the particular block which most-recently stores data. In this case, the controller may erase the origin information stored in the block storing the data which is to be written, and write the origin information in the certain section of the empty block which corresponds to an order number next to one corresponding to the block most-recently storing data.
Each of the plurality of memory blocks may comprise a data area and a redundant bit area. In this structure, the origin information may be stored in the redundant bit area of the empty block which is to store data next to the empty block which most-recently stores data.
According to the second aspect of the present invention, there is provided a storage system comprising: a memory which includes a plurality of memory blocks, each of which stores data and belongs to one of a plurality of zones and to each of which a physical address is assigned; a controller which reads out and outputs data stored in the plurality of memory blocks; and an access device which acquires the data which the controller outputs, and wherein the memory block belonging to a predetermined zone includes a data arrangement memory storing a data arrangement table representing a correspondence between data stored in the memory and a logical address of one memory block storing the data, the controller includes a first table memory, includes a second table memory, and creates a first address conversion table, which stores information representing the logical address and a physical address of the one memory block storing the data arrangement table, and stores the created first address conversion table in the first table memory, said access device provides the controller with a logical address indicating the data arrangement table, said controller specifies the physical address of the one memory block storing the data arrangement table, based on the first address conversion table and the provided logical address indicating the data arrangement table, reads out the data arrangement table from the one memory block indicated by the specified physical address, and outputs the read data arrangement table, the access device specifies a logical address indicating data to be read, based on the data arrangement table which the controller has read out, and the controller specifies a zone to which a memory block indicated by the logical address belongs, based on the logical address which the access device specified, determines whether the second table memory stores a second address conversion table storing information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, creates the second address conversion table when determined that the second table memory does not store the second address conversion table, and stores the created second address conversion table in the second table memory, and specifies, as a physical address indicating data to be read, the physical address corresponding to the logical address which the access device has specified, based on the second address conversion table, reads out and outputs data stored in one memory block represented by the specified physical address.
According to such a storage system, the first address conversion table, which represents the logical address of the block storing the data arrangement table, is kept stored regardless of which zone is specified. Thus, the stored address conversion table is prevented from being updated every time the data arrangement table is accessed. Hence, lateness in the process of accessing data is preventable.
The controller may include an access history memory which stores the physical address, which indicates the data to be read and which the controller has specified, and a logical address representing the physical address, in association with the physical address and the logical address, and specifies a physical address indicating data to be read, based on the logical address and the physical address stored in the access history memory.
According to this structure, even if data stored in any table other than the data arrangement table is to be accessed, as long as accessing is performed to data stored in a block represented by the logical address and the physical address stored in the access history memory, there is no need to create the second address conversion table. Thus, the process of accessing data is effectively performed.
The access device may supply the controller with data to be written and a logical address indicating the data to be written, and the controller may include an empty block table memory storing an empty block table, which stores information representing one or more empty blocks each of which comprises one memory block, select, a target empty block, of the one or more memory blocks represented by the information stored in the empty block table, when data which is to be written and a logical address indicating the data are sent to the controller, and write the data to be written in the selected block.
The empty block tables may include a first empty block table, which stores information representing an empty block belonging to a certain zone including the memory block storing the data arrangement table, and a second empty block table, which stores information representing an empty block belonging to one of the zones. In this case, the controller may determine whether the empty block table memory stores the second empty block table storing information representing an empty block belonging to the specified zone, and creates the second empty block table which stores the information representing the empty blocks belong to the specified zone, and stores the created second empty block table in the empty block table memory when determined that the empty block table memory does not store the second empty block table, select an empty block to store data, of the empty blocks represented by the information stored in the second empty block table, when data which is to be written and a logical address indicating the data are sent to the controller, write, in the empty block represented by the information stored in the first empty block table, the data arrangement table which has been updated as to represent the correspondence between the data, which the controller itself has written in the empty block, and a logical address indicating the data to be written, and update the first empty block table as not to represent that the memory block storing the updated data arrangement table is an empty block.
According to this structure, when updating the data arrangement table, in the case where any change occurs in the memory block storing the data arrangement table, another memory block is newly assigned as one for storing the data arrangement table, using the first empty block table which is stored regardless of which zone is specified. When writing data into a memory block, a memory block is newly assigned as one for storing the data, using the second empty block table representing one or more empty blocks included in the specified zone. Thus, even if the empty block table memory has small memory capacity, the process of data writing and the process of updating the data arrangement table can be performed with high efficiency.
The storage system may store origin information in the memory block, for designating an empty block to store data next to an empty block most-recently stores data, and the empty block table may include information representing order numbers which circularly and respectively correspond to the empty blocks. In such a case, the controller may read the origin information and sequentially select one or more empty blocks including the empty block designated by the read origin information and the empty block following the one represented by the read origin information, when data to be written and a logical address indicating the data are sent to the controller.
By doing this, the process of writing data into empty blocks is cyclically performed one after another. This eliminates the possibility that data is frequently updated only in certain memory blocks. Hence, it is preventable that only some of the memory blocks are deteriorated in its performance, in the case such memory blocks are to be deteriorated upon frequent writing of data thereinto.
The origin information may be stored in a certain section of an empty block which is to store data next to the memory block which most-recently stores data. In this case, the controller may erase the origin information stored in the block storing the data which is to be written, and write the origin information in the certain section of the empty block which corresponds to an order number next to one corresponding to the block which most-recently stores data.
Each of the plurality of memory blocks may comprise a data area and a redundant bit area. In this case, the origin information may be stored in the redundant bit area of the empty block which is to store data next to the empty block most-recently stores data.
According to the third aspect of the present invention, there is provided a memory management method for managing reading of data from a memory, including a plurality of memory blocks, each of which stores data and belongs to one of a plurality of zones and to each of which a physical address is assigned, and wherein the memory block belonging to a predetermined zone is to store a data arrangement table representing a correspondence between the data and a logical address of the memory block storing the data, the method comprising the steps of: creating and storing a first address conversion table storing information representing a correspondence between the logical address and a physical address of the memory block storing the data arrangement table; externally acquiring a logical address indicating the data arrangement table, and specifying the physical address of the memory block storing the data arrangement table, based on the first address conversion table and the acquired logical address, in response to an externally-sent instruction, reading the data arrangement table from the memory block which the specified physical address represents, and externally sending the read data arrangement table; externally acquiring a logical address indicating data to be read, and specifying zone to which a memory block, represented by the acquired logical address, belongs based on the acquired logical address; determining whether a second address conversion table, which stores information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, is created, and creating and storing the second address conversion table when determined that the second address conversion table is not created; and specifying, as a physical address indicating data to be read, the physical address to the externally-acquired physical address, reading and outputting data stored in the memory block represented by the specified physical address.
According to the memory management method, the first address conversion table representing the logical address of the block storing the data arrangement table is kept stored regardless of which zone is specified. This eliminates the occurrence of the event where the stored address conversion table is updated every time the data arrangement table is accessed. Thus, lateness in the process of accessing data can be prevented.
According to the fourth aspect of the present invention, there is provided a memory management method for managing reading of data from a memory, including a plurality of memory blocks, each of which stores data and belongs to one of a plurality of zones and to each of which a physical address is assigned, and wherein the memory block belonging to a predetermined zone is to store a data arrangement table representing a correspondence between the data and a logical address of a memory block storing the data, the method comprising the steps of: creating and storing a first address conversion table storing information representing a correspondence between the logical address and a physical address of the memory block storing the data arrangement table; externally acquiring a logical address indicating the data arrangement table, and specifying a physical address of a memory block storing the data arrangement table based on the first address conversion table and the acquired logical address, in response to an externally-acquired instruction, and reading the data arrangement table from the memory block which the specified physical address represents; specifying a logical address indicating the data to be read, based on the data arrangement table; specifying a zone to which a memory represented by the logical address belongs, based on the specified logical address; determining whether a second address conversion table, which stores information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, is created, and creating the second address conversion table when determined that the second address conversion table is not created; and specifying, as a physical address indicating data to be read, the physical address corresponding to the specified logical address, based on the second address conversion table, reading and outputting data stored in the memory block represented by the specified physical address.
According to such a memory management method, the first address conversion table, which stores the logical address of the memory block storing the data arrangement table, is kept stored regardless of which zone is specified. This eliminates the occurrence of the event where re the stored address conversion table is updated every time the data arrangement table is accessed. Thus, lateness in the process of accessing data can be prevented.
According to the fifth aspect of the present invention, there is provided a computer readable recording medium which stores programs for making a computer function as a controller, which is connected to memory including a plurality of memory blocks, each of which stores data and belongs to on e of a plurality of zones and to each of which a physical address is assigned, and wherein the memory block belonging to a predetermined zone is to store a data arrangement table, which represents a correspondence between the data and a logical address representing a physical address of a memory block storing the data, and wherein the computer: includes a first table memory and a second table memory; creates a first address conversion table, which stores information representing a correspondence between the logical address and a physical address of the memory block storing the data arrangement table, and stores the created first address conversion table in the first table memory; externally acquires a logical address indicating the data arrangement table, and specifies the physical address of the memory block storing the data arrangement table, based on the first address conversion table and the acquired logical address, in response to an externally-sent instruction, reads the data arrangement table from the memory block which the specified physical address represents, and externally sends the read data arrangement table; externally acquires a logical address indicating data to be read, and specifies a zone to which a memory block represented by the logical address belongs, based on the acquired logical address; determines whether the second table memory stores a second address conversion table storing information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, and creates the second address conversion table when determined that the second table memory does not store the second address conversion table, and also stores the created second address conversion table in the second table memory; and specifies, as a physical address indicating data to be read, the physical address corresponding to the externally-acquired logical address, based n the second address conversion table, and reads out and output data stored in a memory block which the specified physical address represents.
According to the computer executing the programs stored on the recording medium, the first address conversion table representing the logical address of the memory block storing the data arrangement table is kept stored regardless of which zone is specified. This eliminates the occurrence of the event where the stored address conversion table is updated every time the data arrangement table is accessed. Thus, lateness in the process of accessing data can be prevented.
According to the sixth aspect of the present invention, there is provided a computer data signal embodied in a carrier wave and representing a program for making a computer function as a controller, which is connected to a memory including a plurality of memory blocks, each of which stores data and belongs to one of a plurality of zones and to each of which a physical address is assigned, and wherein the memory block belonging to a predetermined zone stores a data arrangement table, representing a correspondence between the data and a logical address representing a physical address of a memory block storing the data, and wherein the computer: includes a first table memory and a second table memory; creates a first address conversion table, which stores information representing a correspondence between the logical address and a physical address of the memory block storing the data arrangement table, and stores the created first address conversion table in the first table memory; externally acquires a logical address indicating the data arrangement table, and specifies a physical address of the memory block storing the data arrangement table based on the first address conversion table and the acquired logical address, in response to an externally-sent instruction, reads out the data arrangement table from the memory block represented by the specified physical address, and externally sends the read data arrangement table; externally acquires a logical address indicating data to be read, and specifies a zone to which a memory block represented by the logical address belongs, based on the acquired logical address; determines whether the second table memory stores a second address conversion table storing information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, and creates the second address conversion table when determined that the second table memory does not store the second address conversion table, and also stores the created second address conversion table in the second table memory; and specifies, as a physical address indicating data to be read, the physical address corresponding to the externally-acquired logical address, based on the second address conversion table, and reads and output data stored in the memory block which the specified physical address represents.
According to such a computer executing the program represented by the computer data signal, the first address conversion table, which stores the logical address of the memory block storing the data arrangement table, is kept stored regardless of which zone is specified. This eliminates the occurrence of the event where the stored address conversion table is updated every time the data arrangement table is accessed. Thus, any lateness in the process of accessing data can be prevented.
According to the seventh aspect of the present invention, there is provided a storage device comprising: storage means having a plurality of memory blocks, each of which stores data and belongs to one of a plurality of zones and to each of which a physical block address is assigned; and reading means for reading out data stored in the plurality of memory blocks and externally outputs the read data, wherein the memory block belonging to a predetermined zone further comprising data arrangement memory storing means for storing a data arrangement table representing a correspondence between data stored in said memory and a logical address of one memory block storing the data, and wherein said reading means further comprising; first table storing means for creating a first address conversion table, which stores information representing the logical address and a physical address of the one memory block storing the data arrangement table, and storing the created table, data arrangement table searching means for externally acquiring a logical address indicating the data arrangement table, and specifying the physical address of the one memory block storing the data arrangement table based on said first address conversion table and the acquired logical address, in response to an externally-transmitted instruction, and reading out the data arrangement table from the one memory block represented by the specified physical address, and also externally sending the read data arrangement table, zone specifying means for externally acquiring a logical address indicating data to be read, and specifying one of the plurality of zones, to which a memory block represented by the logical address belongs, based on the acquired logical address, second table storing means for determining whether said second table memory stores a second address conversion table, which stores information representing a correspondence between the logical address and a physical address of the memory block belonging to the specified zone, and when determined that said second table memory does not store the second address conversion table, creating the second address conversion table, and also storing the created table, and data searching means for specifying, as a physical address indicating data to be read, the physical address corresponding to the externally-acquired logical address, based on the second address conversion table, and reading out and output data stored in the memory block which the specified physical address represents.